<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <title>Title</title>
    <link rel="stylesheet" th:href="@{/css/plugins/layui/css/layui.css}" >
</head>
<body>
<div th:object="${student}" class="layui-form">
    <input type="hidden" id="sid" th:field="*{sid}">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">学号</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" id="studentNum"  th:field="*{studentNum}" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">学生姓名</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" id="studentName"  th:field="*{studentName}" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <input type="hidden" id="gender" name="gender">
            <label class="layui-form-label">性别</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="radio" name="gender" value="0" title="男" lay-filter="gender" th:checked="${student.gender =='0'}">
                <input type="radio" name="gender" value="1" title="女" lay-filter="gender" th:checked="${student.gender == '1'}">
                <input type="radio" name="gender" value="2" title="保密"lay-filter="gender" th:checked="${student.gender == '2'}">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">年龄</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" id="age"  th:field="*{age}" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">生日</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" id="birthday"  th:field="*{birthday}" class="layui-input">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">班级</label>
            <div class="layui-input-inline layui-input-wrap">
                <select id="classId" name="classId" th:with="clas=${@classService.list()}">
                    <option value="">请选择</option>
                    <option th:each="d:${clas}" th:text="${d.className}" th:value="${d.classId}" th:selected="${d.classId == student.classId}"></option>
                </select>
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">专业</label>
            <div class="layui-input-inline layui-input-wrap">
                <select id="major" name="major" th:with="majors=${@majorService.list()}">
                    <option value="">请选择</option>
                    <option th:each="d:${majors}" th:text="${d.majorName}" th:value="${d.majorId}" th:selected="${d.majorId == student.majorId}"></option>
                </select>
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">宿舍号</label>
            <div class="layui-input-inline layui-input-wrap">
                <select id="hid" name="hid" th:with="hids=${@hotelService.list()}">
                    <option value="">请选择</option>
                    <option th:each="d:${hids}" th:text="${d.hotelName}" th:value="${d.hotelId}" th:selected="${d.hotelId == student.hotelId}"></option>
                </select>
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">住址</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" id="homeAddress"  th:field="*{homeAddress}" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">电话</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" id="phone"  th:field="*{phone}" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">邮箱</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" id="email"  th:field="*{email}" class="layui-input">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <input type="hidden" id="status" name="gender">
            <label class="layui-form-label">学生状态</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="radio" name="status" value="0" title="在读" lay-filter="status" th:checked="${student.status =='0'}">
                <input type="radio" name="status" value="1" title="毕业" lay-filter="status" th:checked="${student.status == '1'}">
            </div>
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">紧急联系人</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" id="emergencyContact"  th:field="*{emergencyContact}" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">紧急联系人电话</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" id="emergencyContactPhone"  th:field="*{emergencyContactPhone}" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">更新人</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" id="updateBy"  th:field="*{updateBy}" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-inline layui-input-wrap">
                <input type="text" id="remark"  th:field="*{remark}" class="layui-input">
            </div>
        </div>
    </div>

</div>
<script th:src="@{/js/jquery.min.js}"></script>
<script th:src="@{/js/plugins/layui/layui.js}"></script>
<script>
    layui.use(function(){
        var laydate=layui.laydate;
        var form = layui.form;
        var $=layui.$;
        var layer=layui.layer;
        laydate.render({
            elem:'#birthday'
            ,type:'date'
        })
        form.on('radio(gender)', function(data){
            $('#gender').val(data.value);
        })
        form.on('radio(status)', function(data){
            $('#status').val(data.value);
        })
    })
</script>
</body>
</html>
